import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {

	public static void main(String[] args) {
	 Set<String> words=new TreeSet<>();
	 Scanner in=new Scanner(System.in);
	 while(true)
	 {
		 String word=in.next();
		 if(word.equals("!!!!!"))
			 break;
		 words.add(word);
	 }
	 System.out.println(words.size());
	 int i=0;
	 for(String e:words)
	 {   if(i++<10)
		 System.out.println(e);
	 }
	 in.close();
	}
    
}